[BLKTAP] Fix crash at start-of-day in blktapctrld
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 6 Oct 2006 14:05:30 +0000 (15:05 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 6 Oct 2006 14:05:30 +0000 (15:05 +0100)
if /local/domain does not exist.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/blktap/lib/xs_api.c

index 4df73e15125728f4ff6581d3053c212914fb2a5a..86253ca7dd607bc1f7fba030fe6e9c690a84ace0 100644 (file)
@@ -179,6 +179,8 @@ char *get_dom_domid(struct xs_handle *h)
        }
        
        e = xs_directory(h, xth, "/local/domain", &num);
+       if (e == NULL)
+           return NULL;
 
        for (i = 0; (i < num) && (domid == NULL); i++) {
                asprintf(&path, "/local/domain/%s/name", e[i]);